<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<body>
	
<script type="text/javascript">
		//butnList colId  type  jsUrl   panelTitle  prefix 
		var formId = '';
		var dsId = '${params.dsId}';
		var clnName = '${params.clnName}';
		var keyValue = '${params.keyValue}';
		
		function closeUPanel(){
			$('#${params.clnName}upImgDiv').window('close');
			$('#${params.clnName}upImgDiv').remove();
		}
		/***
		*表单上传校验
		***/
		function upSubmit(obj){
			$('${params.clnName}form1  #msg').html('');
			console.log($('#file'));
		if($('#file').val() == ''){
			$('#msg').html("<span style='color:red;'>请选择需要上传的文件!</span>");
				return false;
			}

			var keyValue = $('#${params.dsId}${params.clnName}').parent().find('input[qucln=${params.clnName}]').val();
			$(obj).attr('action',"${pageContext.request.contextPath}/model/upload/multiUpload.jsp?dsId=${params.dsId}&clnName=${params.clnName}&flag=${params.flag}&keyValue="+keyValue);
		}
		
		/**
		检查文件是否已经选择
		**/
		function checkFile(){
			$('#msg').html('');
		}
		
</script>
	<div id='${params.clnName}upImgDiv'>
		<c:if test="${params.flag == '1'}"> <!-- 图片上传 -->
			<font color="GREEN">支持JPG,JPEG,GIF,BMP,PNG文件的上传</font>
		</c:if>
		<form action="" 
			id="${params.clnName}form1" name="form1" encType="multipart/form-data"  
			onsubmit="return upSubmit(this)"  method="post" target="hidden_frame" >      
			<span id="msg" style="float: left;">&nbsp;</span>
			<br/>
			 	<input type="file" id="file" name="file" style="width:450" onchange="checkFile()">      
			  	<!--文件名:-->
			  	描述:<input id="describe" name="describe"/>
			  	<input id="name" type="hidden" name="name"/>
			  	<span id="msg"></span>
			 <br>
			 <div style="width: 100%" align="right">
				<INPUT type="submit"  value="上传文件">
				<INPUT type="button" onclick='closeUPanel()' value="关闭">
			</div>
		</form>
		<iframe name='hidden_frame' id="hidden_frame" style='display:none'></iframe> 
		<div id='showFiles'></div>
	</div>
	
</body>
